<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">
<h:body>
	<ui:composition template="/secured/workarea.xhtml">
		<ui:define name="espacio_trabajo">
			<h:form>
				<p:growl id="growl" showDetail="true" sticky="false" />
				<p:panel id="board1" header="#{msg.perfil }" toggleable="true">
					<h:panelGrid columns="2">
						<h:outputText value="#{msg.nombre }" />
						<h:outputText value="#{beanDashboard.nombre }"
							style="font-weight:bold;" />
						<h:outputText value="#{msg.perfil }" />
						<h:outputText value="#{beanDashboard.nombreRol }"
							style="font-weight:bold;" />
					</h:panelGrid>
				</p:panel>
				<p:panel id="board2" header="#{msg.documentacion }"
					visible="#{beanDashboard.activeDocumentos }">
					<!-- 
					<p:commandButton id="deleteButton" value="#{msg.eliminar }"
						icon="ui-icon-trash" onclick="borrarDialog.show()" update="growl" />
					<p:commandButton id="viewButton" value="#{msg.ver }"
						icon="ui-icon-search" oncomplete="verDialog.show()"
						update="displayVer, growl" />
						-->
					<p:commandButton id="nuevoButton" value="#{msg.nuevo }"
						icon="ui-icon-plusthick" onclick="nuevoDialog.show()"
						update="displayNuevo, growl" />
					<p:dataTable value="#{beanDashboard.listaDocs }" var="item"
						paginator="true" paginatorPosition="bottom" rows="10" id="table"
						rowKey="#{item.idDoc}" selection="#{beanDashboard.itemSelected}">
						<!-- <p:column selectionMode="single" style="width:2%" /> -->
						<p:column id="name2" headerText="#{msg.nombre}"
							sortBy="#{item.accion}" filterBy="#{item.nombre}">
							<h:outputText id="nameCell2" value="#{item.nombre}" />
						</p:column>
						<p:column id="estatus" headerText="#{msg.estatus }"
							sortBy="#{item.estatus}" filterBy="#{item.estatus}">
							<h:outputText value="#{item.estatus }" />
						</p:column>
					</p:dataTable>
					<!-- Panel de Ver -->
					<p:dialog id="dialog" header="#{msg.ver}" widgetVar="verDialog"
						modal="true" draggable="false" width="260px" height="300px">
						<h:panelGrid id="displayVer" columns="2">
							<h:panelGroup id="messagePanelVer" layout="block">
								<h:messages errorStyle="color: red" infoStyle="color: green"
									layout="list" style="font-size:12px;font-family:Arial" />
							</h:panelGroup>
							<h:outputText />
							<h:outputText value="Texto dfdfdf" />
							<p:commandButton id="aceptarVerBtn" value="#{msg.aceptar}"
								icon="ui-icon-check" onclick="verDialog.hide()" />
						</h:panelGrid>
					</p:dialog>
					<!-- Fin de panel de Ver -->
					<!--  Inicio panel de Nuevo -->
					<p:dialog id="dialogNuevo" header="#{msg.frsNuevoRegistro}"
						widgetVar="nuevoDialog" closable="true" modal="true"
						position="top" draggable="false" width="400" resizable="true">
						<h:panelGrid columns="1" width="100%" id="displayNuevo">
							<h:panelGrid columns="2">
							<h:outputText value="#{msg.estatus}: *"/>
							<p:selectOneMenu value="#{beanDashboard.idEstatus}">
								<f:selectItem itemLabel="Selecciona un estatus" noSelectionOption="true" itemValue="0"/>
								<f:selectItems value="#{beanDashboard.listSelectItemsEstatus}"/>
							</p:selectOneMenu>
							</h:panelGrid>
							<p:fileUpload label="#{msg.frsSeleccionar }" fileLimit="1"
								showButtons="false" uploadLabel="#{msg.cargar }"
								cancelLabel="#{msg.cancelar }" update="growl table"
								fileUploadListener="#{beanDashboard.handlerNuevoFileUpload}"
								 />							
						</h:panelGrid>
						<h:panelGrid style="float: right;" columns="2">
							<p:commandButton value="#{msg.aceptar }" icon="ui-icon-check"
								actionListener="#{beanDashboard.save }"
								update="table growl displayNuevo" />
							<p:commandButton value="#{msg.cancelar }"
								icon="ui-icon-closethick" onclick="nuevoDialog.hide()"
								actionListener="#{beanDashboard.saveCancel }" />
						</h:panelGrid>
					</p:dialog>
					<!-- Fin de panel de nuevo -->
					<!-- Panel de borrado -->
					<p:confirmDialog showEffect="fade" widgetVar="borrarDialog"
						header="#{msg.confirmar }" message="#{msg.frsBorrarConfirmacion }">
						<p:commandButton value="#{msg.si }"
							actionListener="#{beanDashboard.delete}" update="table growl"
							styleClass="ui-confirmdialog-yes" icon="ui-icon-check"
							oncomplete="borrarDialog.hide()" />
						<p:commandButton value="#{msg.no }" type="button"
							styleClass="ui-confirmdialog-no" icon="ui-icon-close"
							onclick="borrarDialog.hide()" />
					</p:confirmDialog>
					<!-- Fin de panel de borrado -->
				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>